import QtQuick 2.6


/*
* Use this to simplify loader initializations.
* Without this, every loader needs a id to be idenditied.
* usage :
* LoaderMouseArea {
*     anchors.fill: parent
*     onClicked: loader.source = "ABC.qml" // important
*     loader: Loader {
*         parent: indexRoot
*         anchors.fill: parent
*     }
* }
*/

MouseArea {
    property Loader loader
    Connections {
        ignoreUnknownSignals: true
        target: loader.item
        onVisibleChanged: {
            if (loader.item && !loader.item.visible) {
                loader.source = ""
                loader.sourceComponent = null
            }
        }
    }
}
